<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定时器</title>
</head>
<body>
<script type="text/javascript">
  // setTimeout(function(){
  //     alert(123);
  // },1000);
   function f1(){console.log("hello");}
  // setTimeout(f1,3000);

  //清除定时器
  var timeout = setTimeout(f1,3000);
  //var timeout1 = setTimeout(f1,3000);
  console.log(timeout);
  //console.log(timeout1);
  clearTimeout(timeout);
  setInterval(f1,1000);
</script>
</body>
</html>